<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回警告和错误信息</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="datetime.createfrominterface.html">« DateTime::createFromInterface</a></li>
      <li style="float: right;"><a href="datetime.modify.html">DateTime::modify »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.datetime.html">DateTime</a></li>
    <li>返回警告和错误信息</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="datetime.getlasterrors" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTime::getLastErrors</h1>
  <h1 class="refname">date_get_last_errors</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTime::getLastErrors</span> -- <span class="refname">date_get_last_errors</span> &mdash; <span class="dc-title">返回警告和错误信息</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetime.getlasterrors-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>DateTime::getLastErrors</strong></span>(): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.date-get-last-errors.html" class="methodname">date_get_last_errors</a></span>(): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   跟 <span class="methodname"><a href="datetimeimmutable.getlasterrors.html" class="methodname">DateTimeImmutable::getLastErrors()</a></span> 一样，但适用于
   <span class="classname"><a href="class.datetime.html" class="classname">DateTime</a></span>。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetime.getlasterrors-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetime.getlasterrors-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回包含警告和错误信息的数组，如果没有任何警告或者错误，则返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-datetime.getlasterrors-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="datetimeimmutable.getlasterrors.html" class="function" rel="rdfs-seeAlso">DateTimeImmutable::getLastErrors()</a> - Returns the warnings and errors</span></li>
  </ul>
 </div>


</div></div></div></body></html>